
const verifyLogin = async  (req, res, next) => {
  const user = req.body;
  const { username, password} = user;
  // 检查参数是否正确
  if(!username || !password){
    const err = new Error(`用户名或密码不能为空`);
    err.statusCode = 400; // 设置状态码
    next(err); // 传递给错误处理中间件
  }

  next()
}

module.exports = {
  verifyLogin
}
